{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
	.bg-1 {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}
 .radius:hover{
 	background:#e5e5e5;
 	border-color: #e5e5e5;
 	color: #333;
 }
 span:hover{
 	color: #333;
 }
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
   
系统管理
    <span class="c-gray en">&gt;</span>
 APP管理
  <span class="c-gray en">&gt;</span>
版本管理
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  
  <div style="padding:20px;height:30px;">
  	
  	<div class="new_box">

  <div style="height:30px;">
    <div style="float:left; height: 40px;width: 100%;background-color: #e5e5e5 !important; border-bottom: 1px solid #e4e7ed;">
     <a href="{:url(\'Statistics/addVersion\')}" class="btn btn-primary radius" style="background: #636363;border-color: #636363;color: #fff;">新增版本</a>
     <a class="btn btn-primary radius app_update" style="float:right;background: #636363;border-color: #636363;color: #fff;">热更新通知<i class="Hui-iconfont" id="iconfont">&#xe6d5;</i></a>
    </div>
      <div id="app_update" style="position: absolute;right: 20px;top: 100px;display: none;">
          <button style="padding: 5px;background-color: #409EFF;" onclick="appUpdate(1)">IOS热更新</button><br>
          <button style="padding: 5px;background-color: #409EFF;" onclick="appUpdate(2)">Android热更新</button>
      </div>
  </div>

  <div class="page-container dataTables_wrapper">
      <div id="tab-system" class="HuiTab">
        <div class="tabCon">
          <div class="mt-20">
            <table
              class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
              <thead>
                <tr class="text-c">
         
                  <th>序号</th>
                  <th>最新版本</th>
                  <th>文件路径</th>
                  <th>上传时间</th>
				  <th>类型</th>
				  <th>系统</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
  				{foreach ($list as $value)}
               <tr class="text-c">
           		
                  <td>
                 		{$value.number}
                  </td>
                  <td>{$value.version}</td>
                  <td>{$value.version_url}</td>
                  <td>{$value.url_time|date="Y-m-d H:i:s",###}</td>
                  <td>{if($value.type==1)}收款监听APP{/if}{if($value.type==2)}赢彩APP{/if}</td>
                  <td>{if($value.systemtype==1)}安卓{/if}{if($value.systemtype==2)}ios{/if}</td>
                  <td>
                    <a style="text-decoration:underline" class="ml-5" onclick="Jurisdiction('版本列表','/admin/statistics/versionManagement?type={$value.type}&system={$value.systemtype}',1200,600)" href="javascript:;">查看相关列表</a>
                  </td>
                </tr>
				{/foreach}
              </tbody>
            </table>
          </div>
        </div>
      </div>
     
  </div>
  
  </div>
</div>
{/block}

{block name="js"}
  <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
  <script type="text/javascript">
    $(function() {
      $('.skin-minimal input').iCheck({
        checkboxClass : 'icheckbox-blue',
        radioClass : 'iradio-blue',
        increaseArea : '20%'
      });
      $("#tab-system").Huitab({
        index : 0
      });
        $('.app_update').click(function(){
           var status = $('#app_update').css('display');
            if( 'none'==status ){
                $('#app_update').css('display','block');
                $('#iconfont').html('&#xe6d6;');
            }else{
                $('#app_update').css('display','none');
                $('#iconfont').html('&#xe6d5;');
            }
        });
    });
    
</script>
<script type="text/javascript">
function Jurisdiction(title,url,w,h){
    layer.open({
        type: 2,
        area: [w+'px', h +'px'],
        fix: false, //不固定
        maxmin: true,
        shade:0.4,
        title: title,
        content: url,
        end : function(){
            location.reload();
        }
    });
}

function pay_detail(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		area: ['90%', '90%'],
		content: url
	});
}

function pay_account(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		area: ['90%', '90%'],
		content: url
	});
}

$(".open").click(function(){
	var open = $(this).attr('id');
	var status = $("#"+open).html();
	var tid = open.substr(5);
	$.ajax({
        type : "post",
        url : "{:url('paysetting/updateOpen')}",
        data : {"open":status,"uid":tid},
        success: function (data) {
        	if(data=='1') {
        		if(status=='开'){
        			$("#"+open).html('关');
        		}else{
        			$("#"+open).html('开');
        		}
        	} else {
        		layer.msg('更新失败', {icon: 5});
        		return false;
        	}
        }
    });
})
    function appUpdate(type){
        var title = '';
        if(1==type){
            title = '确定要给IOS发送热更新信息吗？？';
        }else{
            title = '确定要给Android发送热更新信息吗？？';
        }
        if( confirm( title ) ){
            $.ajax({
                type : "post",
                url : "{:url('Jpushtest/pushMessages')}",
                data : {"type":type,'message':'update'},
                success: function (data) {
                    if(1==parseInt(data)) {
                        layer.msg('发送成功', {icon: 1});
                    } else {
                        layer.msg('发送失败', {icon: 5});
                    }
                }
            });
        }
    }
</script>
{/block}
